package main

import (
    //"fmt"
	"thirdpaysdk/api/hnapay"
	"github.com/astaxie/beego"
	//"io/ioutil"
)

func microApp() {
   
	merCode := "10000000050"
	secreCode := "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCXaLnL8jFJgQ1DSqtvZVo9E0sHGRih+G30ORUzaTfAJF+pkVe7g6nLlVLUoWUZlpseIho6NsEmFqkLjO0tzry80LR4rLMjSMCdoVTBenHKS2pSsL0WhhpF3a/QtRGjvIA9EL0sxIsBQR/UyCVIZs824G4Uywvv+6snrgHDUGDlBwIDAQAB"
	orderId := "50130000008107"
	displayName := "大黄蜂科技"
	goodsName := "测试商品"
	goodsCount := 1
	amount := 100
	currency := "CNY"
	tradeType := "0001"
	payType := "5"
	shareFlag := "0"
	noticeUrl := "https://api.dhfapp.com" + "/public/hnapay/notify"
	openId := "oQlEQ0RqFx7ufQUbkrNB8xouAgDI"
	rsp, err := hnapay.MicroAppPay(merCode,orderId,displayName,goodsName,goodsCount,amount,currency,tradeType,payType,shareFlag,noticeUrl,secreCode,openId)
	if err != nil {
	   beego.Debug("MicroAppPay error:", err.Error())
	   return
	}
	beego.Debug("MicroAppPay Package:", string(rsp.Package))
}

